package com.swufe.week6;

import androidx.appcompat.app.AppCompatActivity;

import android.app.AlertDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Adapter;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.ListAdapter;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

public class Week11 extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_week11);
        //GridView gridView=findViewById(R.id.mygrideview);
        GridView gridView=findViewById(R.id.mygrideview);
        List<String> list11=new ArrayList<>();
        for (int i = 1;i<100;i++){
            list11.add("列表"+ i);
        }
        ListAdapter adapter=new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1,list11);
        gridView.setAdapter(adapter);
        gridView.setEmptyView(findViewById(R.id.textView));
        //listView.setAdapter(adapter);

    }

}